package io.renren.modules.gengyun.feign;

import io.renren.modules.gengyun.Config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@FeignClient(value = "gengyun-upload",configuration = FeignConfig.class)
public interface FileTestFeignService {
    @RequestMapping(value = "/tesT/uploadFiles", method = RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    ResponseEntity<String> create(@RequestParam("access_token") String accessToken, @RequestPart("file") MultipartFile file) ;


    @RequestMapping(value = "/BigFile", method = RequestMethod.POST,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    void upload(
            @RequestParam("name") String name,
            @RequestParam("md5") String md5,
            @RequestParam("size") Long size,
            @RequestParam("chunks") Integer chunks,
            @RequestParam("chunk") Integer chunk,
            @RequestPart("file") MultipartFile file) ;

}
